package com.koko.controller;

import com.koko.game.entity.Game;
import com.koko.result.Result;
import com.koko.service.WishlistService;
import com.koko.user.entity.Wishlist;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class WishlistController {
    @Autowired
    private WishlistService wishlistService;

    /**
     * 添加至愿望单
     * @param wishlist
     * @return
     */
    @PostMapping("/wishlist")
    public Result<String> addGameToWishList(@RequestBody Wishlist wishlist) {
        wishlistService.addGameToWishlist(wishlist.getGameId());
        return Result.success();
    }
}
